<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
    <div class="container">
        <a href="/add" class="btn btn-success">添加数据</a>
        <h4 class="jumbotron">列表数据</h4>

        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>标题</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {{ each blog }}
                <tr>
                    <td>{{ $index}}</td>
                    <td><a href="/detail?id={{@ $value._id}}">{{$value.title}}</a></td>
                    <td>
                        <a href="/doDelete?id={{@ $value._id}}" class="btn btn-danger">删除<a/>
                        <a href="/edit?id={{@ $value._id}}" class="btn btn-info">修改<a/>
                    </td>
                </tr>
                {{/each}}
            </tbody>
        </table>
    </div>




    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</body>

</html>